<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>用户注册</title><link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">

    <!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap-theme.min.css" integrity="sha384-6pzBo3FDv/PJ8r2KRkGHifhEocL+1X2rVCTTkUfGk7/0pbek5mMa1upzvWbrUbOZ" crossorigin="anonymous">

    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
    <script src="https://code.jquery.com/jquery.js"></script>
    <style>

        .container1 {
            margin-top: 70px;
            width: 45%;
            margin-left: 30%;
        }

        /* 需要在一行的元素 */
        .inline-style {
            display: inline-block;
        }
        /* 文字需要靠右 */
        .font-position-right{
            text-align: right;
        }
        /* 注册按钮 */
        .register-btn{
            margin-left: 10%;
        }


    </style>
</head>
<body>
<div class="container1">
    <div style="padding-top: 100px"></div>
    <form class="form-horizontal">
        <div class="form-group">
            <!--<h2 class="form-signin-heading">注册</h2>-->
            <!-- class="sr-only"将label标签隐藏 -->
            <label for="Username" class="col-sm-2 control-label inline-style font-position-right">用户名</label>
            <div class="col-sm-9 inline-style ">
                <input type="text" class="form-control" id="Username" placeholder="用户名">
            </div>
        </div>
        <div class="form-group" style="padding-top: 15px">
            <!--<h2 class="form-signin-heading">注册</h2>-->
            <label for="Username" class="col-sm-2 control-label  inline-style font-position-right">密码</label>
            <div class="col-sm-9  inline-style">
                <input type="password" class="form-control" id="Password" placeholder="密码">
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <div class="checkbox">
                    <label>
                        <!--<input type="checkbox">
                        记住密码-->
                    </label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-7">
                <button class="btn btn-lg btn-primary btn-block register-btn" type="button" onclick="register()">注册</button>
            </div>

        </div>
    </form>
</div>
</body>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.js"></script>
<script>

    function register(){
        let usrName = $("#Username").val()
        let pwd = $("#Password").val()
        $.ajax({
            method:'get',
            dataType:'json',
            url:'/register',
            data:{usrName:usrName,pwd:pwd},
            success:function (message){
                alert(message.msg)
            }
        })
    }

</script>
</html>